{% extends "../../main.html" %}

{% block title %}{{ _("Game Management")}}{% end %}

{% block header %}
<link rel="stylesheet" href="/static/css/pages/admin/game_objects.css" type="text/css" />
<link rel="stylesheet" href="/static/css/markdown-toolbar.css" type="text/css" />
<script src="/static/js/libs/commonmark.min.js"></script>
<script src="/static/js/libs/markdown-toolbar.js"></script>
<script src="/static/js/pages/admin/view/game_objects.js"></script>
<script src="/static/js/pages/admin/view/statistics.js"></script>
<script src="/static/js/pages/anchor.js"></script>
{% end %}

{% block modals %}
{% from models.Corporation import Corporation %}
{% from models.Category import Category %}
{% from tornado.options import options %}
{% from libs.XSSImageCheck import filter_avatars %}
{% from models.Box import Box %}
{% from models.GameLevel import GameLevel %}
{% from models.Flag import Flag, FLAG_TYPES %}
{% from models.Flag import FLAG_CHOICE %}
{% from models.FlagChoice import FlagChoice %}
    {% set avatars = filter_avatars("box") %}
    <!-- Lock Box Form -->
    <form id="lock-box-form" action="/admin/lock/box" method="post">
        {% raw xsrf_form_html() %}
        <input id="lock-box-uuid" name="uuid" type="hidden" />
    </form>
    <!-- Lock Flag Form -->
    <form id="lock-flag-form" action="/admin/lock/flag" method="post">
        {% raw xsrf_form_html() %}
        <input id="lock-flag-uuid" name="uuid" type="hidden" />
    </form>
    <!-- Select Avatars -->
    <div id="change-box-avatar-modal" class="modal hide fade" style="z-index: 100000; display: none; {% if len(avatars) > 0 %}width: 750px; margin-left: -375px;{% end %}">
        <div class="modal-header">
            <button id="avatarclose" type="button" class="close" data-dismiss="modal">&times;</button>
            <h3>{{ _("Change Avatar") }}</h3>
        </div>
        <div class="modal-body">
            {% raw xsrf_form_html() %}
            {% for avatar in avatars[::3] %}
                <div class="row">
                    <div class="span3">
                        <center>
                            <a href="#" class="boxavatarimg" value="{{avatar}}"><img src="/avatars/{{avatar}}"  class="img-polaroid" style="width: 200px;"></a>
                        </center>
                    </div>
                    {% if avatars.index(avatar) + 1 < len(avatars) %}
                        {% set avatar1 = avatars[avatars.index(avatar) + 1] %}
                        <div class="span3">
                            <center>
                                <a href="#" class="boxavatarimg" value="{{avatar1}}"><img src="/avatars/{{avatar1}}"  class="img-polaroid" style="width: 200px;"></a>
                            </center>
                        </div>
                    {% end %}
                    {% if avatars.index(avatar) + 2 < len(avatars) %}
                        {% set avatar2 = avatars[avatars.index(avatar) + 2] %}
                        <div class="span3">
                            <center>
                                <a href="#" class="boxavatarimg" value="{{avatar2}}"><img src="/avatars/{{avatar2}}"  class="img-polaroid" style="width: 200px;"></a>
                            </center>
                        </div>
                    {% end %}
                </div>
                <br/>
            {% end %}
        </div>
    </div>
    <!-- Edit Corporation -->
    <div id="edit-corporation-modal" class="modal hide fade" style="display: none;">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-pencil"></i> {{ _("Edit Corporation") }}</h3>
        </div>
        <div class="modal-body">
            <form id="edit-corporation-form" class="form-horizontal" method="post" action="/admin/edit/corporation">
                {% raw xsrf_form_html() %}
                <input id="edit-corporation-uuid" name="uuid" value="" type="hidden" />
                <div class="control-group">
                    <label class="control-label" for="corporation_name">{{ _("Name") }}</label>
                    <div class="controls">
                        <input id="corporation-name" name="name" type="text" maxlength="32" placeholder="{{ _('Corporation Name') }}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="corporation_description">{{ _("Description") }}</label>
                    <div class="controls">
                        <textarea id="corporation-description" name="description" maxlength="512" type="text" placeholder="{{ _('Optional') }} {{ _('Description') }}"></textarea>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="edit-corporation-submit" class="btn btn-primary" type="button">
                <i class="fa fa-save"></i>
                {{_("Save")}}
            </button>
        </div>
    </div>
    <div id="delete-corporation-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-times-circle-o"></i> {{ _("Delete Corporation") }}</h3>
        </div>
        <div class="modal-body">
        <p>
            {{ _("Are you sure you want to delete this corporation?") }} <br />
            <br />
            <strong>{{ _("WARNING") }}:</strong> {{ _("This will also delete associated IP addresses, boxes, and flags.") }}
        </p>
        <form id="delete-corporation-form" method="post" action="/admin/delete/corporation">
            {% raw xsrf_form_html() %}
            <input id="delete-corporation-uuid" name="uuid" type="hidden" value="" />
        </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="delete-corporation-submit" type="button" class="btn btn-danger">
                <i class="fa fa-fw fa-times-circle-o"></i>
                {{ _("Delete") }}
            </button>
        </div>
    </div>
    <!-- Edit Box -->
    <div id="edit-box-modal" class="modal hide fade" style="display: none;">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-pencil"></i> {{ _("Edit Box") }}</h3>
            <div style="padding-left: 5px;">{{ _("Note: Files or documents for the challenge can be placed in the Game Materials.") }}</div>
        </div>
        <div class="modal-body">
            <form id="edit-box-form" class="form-horizontal" method="post" action="/admin/edit/box" enctype="multipart/form-data">
                {% raw xsrf_form_html() %}
                <input id="box-uuid" name="uuid" value="" type="hidden" />
                <div class="control-group">
                    <label class="control-label" for="box_name">{{ _("Box Name") }}</label>
                    <div class="controls">
                        <input id="box-name" name="name" type="text" placeholder="{{ _('Box Name') }}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="game_level">{{_("Game Level")}}</label>
                    <div class="controls">
                        <select id="edit-box-game-level" name="game_level">
                            {% for level in GameLevel.all() %}
                            <option value="{{ level.uuid }}">{{ level.name }}</option>
                            {% end %}
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="box_corporation">{{ _("Corporation") }}</label>
                    <div class="controls">
                        <select id="edit-box-corporation" name="corporation_uuid">
                            {% for corporation in Corporation.all() %}
                                <option value="{{ corporation.uuid }}">{% if corporation.name != "" %}{{ corporation.name }}{% else %}({{ _("No name") }}){% end %}</option>
                            {% end %}
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="box_catetory">{{ _("Category") }}</label>
                    <div class="controls">
                        <select id="edit-box-category" name="category_uuid">
                            <option value=""></option>
                            {% for category in Category.all() %}
                                <option value="{{ category.uuid }}">{{ category.category }}</option>
                            {% end %}
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="edit-box-operating_system">{{ _("System Type") }}</label>
                    <div class="controls">
                        <select id="edit-box-operating_system" name="operating_system">
                            <option value="linux">
                                Linux
                            </option>
                            <option value="windows">
                                Windows
                            </option>
                            <option value="apple">
                                MacOS
                            </option>
                            <option id="type_unknown" value="?">
                                {{ _("Unknown") }}
                            </option>
                            <option value="none">
                                {{ _("None") }}
                            </option>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="box-value">{% if options.banking %}{{ _("Reward") }}{% else %}{{ _("Points") }}{% end %}</label>
                    <div class="controls">
                        <input id="box-value" name="value" type="number" pattern="[0-9]+" placeholder="{% if options.banking %}{{_('$')}} {{_('Reward')}}{% else %}{{_('Points')}}{% end %}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="box_description">{{_("Description")}}</label>
                    <div class="controls">
                        <textarea rows="4" class="toolbar" id="box-description" name="description" placeholder="{{_('Description')}}" ></textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="box_difficulty">{{_("Difficulty")}}</label>
                    <div class="controls">
                        <input id="box-difficulty" name="difficulty" type="text" placeholder="{{_('Difficulty Rating')}}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="flag_submission_type">
                        {{ _("Flag Submission Type") }}
                    </label>
                    <div class="controls">
                        <input id="box-flag_submission_type" name="flag_submission_type" type="hidden" value="CLASSIC" />
                        <div id="box-flag-submission-type-button" class="btn-group" data-toggle="buttons-radio">
                            <button id="box-flag-submission-type-classic" type="button" class="btn btn-primary">
                                <i id="box-flag-submission-type-classic-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Classic") }}
                            </button>
                            <button id="box-flag-submission-type-single-box" type="button" class="btn btn-primary">
                                <i id="box-flag-submission-type-single-box-icon" class="fa fa-fw fa-square-o"></i>
                                {{ _("Single Box") }}
                            </button>
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="box_avatar">{{ _("Avatar")}}</label>
                    <div class="controls">
                        <a id="uploadbutton" class="btn btn-primary" href="#">{{ _("Upload") }}</a>
                        <input id="box-avatar" name="avatar" type="file" style="display: none;"/>
                        <input id="box_avatar_select" name="box_avatar_select" type="hidden" />
                        {% if len(avatars) > 0 %}&nbsp;&nbsp;<a id="change_avatar_button" data-toggle="modal" class="btn btn-primary" href="#change-box-avatar-modal">{{_("Choose")}}</a>{% end %}
                        &nbsp;&nbsp;<a id="removeavatar" class="btn btn-primary" href="#">{{ _("None")}}</a>
                        <div id="avatarfilename" style="padding: 5px;"></div>
                    </div>
                </div>
                {% if options.story_mode %}
                <div class="control-group">
                    <label class="control-label" for="box-capture_message">{{_("Capture Message")}}</label>
                    <div class="controls">
                        <textarea rows="4" id="box-capture_message" name="capture_message" placeholder="({{_('Optional')}}">
                        </textarea>
                    </div>
                </div>
                {% end %}
            </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="edit-box-submit" type="button" class="btn btn-primary">
                <i class="fa fa-fw fa-save"></i>
                {{_("Save")}}
            </button>
        </div>
    </div>
    <div id="delete-box-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-times-circle-o"></i> {{_("Delete Box")}}</h3>
        </div>
        <div class="modal-body">
        <p>
            {{_("Are you sure you want to delete this box?")}} <br />
            <br />
            <strong>{{_("WARNING")}}:</strong> {{_("This will also delete associated IP addresses, hints, and flags.")}}
        </p>
        <form id="delete-box-form" method="post" action="/admin/delete/box">
            {% raw xsrf_form_html() %}
            <input id="delete-box-uuid" name="uuid" type="hidden" value="" />
        </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="delete-box-submit" type="button" class="btn btn-danger">
                <i class="fa fa-fw fa-times-circle-o"></i>
                {{_("Delete")}}
            </button>
        </div>
    </div>
    <!-- Edit Flag -->
    <div id="edit-flag-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-pencil"></i> {{_("Edit Flag")}}</h3>
            <div style="padding-left: 5px;">{{_("Note: Files or documents for the challenge can be placed in the Game Materials.")}}</div>
        </div>
        <div class="modal-body">
            <form id="edit-flag-form" class="form-horizontal" method="post" action="/admin/edit/flag">
                {% raw xsrf_form_html() %}
                <input id="flag-uuid" name="uuid" type="hidden" />
                <input id="flag-flagtype" name="flagtype" type="hidden" />
                <div class="control-group">
                    <label class="control-label" for="flag-name">{{_("Flag Name")}}</label>
                    <div class="controls">
                        <input id="flag-name" maxlength="16" name="name" type="text" placeholder="({{_('Optional')}}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="edit-flag-box">{{_("Box")}}</label>
                    <div class="controls">
                        <select id="edit-flag-box" name="box_uuid">
                            {% for box in Box.all() %}
                                <option value="{{ box.uuid }}">{{ box.name }}</option>
                            {% end %}
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="edit-flag-type">{{_("Flag Type")}}</label>
                    <div class="controls">
                        <select id="edit-flag-type" name="flag_type">
                            {% for item in FLAG_TYPES %}
                                <option id="edit-type-{{item}}" class="typeoption" value="{{ item }}">
                                    {{ item }}
                                </option>
                            {% end %}
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="flag-value">{% if options.banking %}{{_("Reward")}}{% else %}{{_("Points")}}{% end %}</label>
                    <div class="controls">
                        <input id="flag-value" name="value" type="number" placeholder="{% if options.banking %}($) {% end %}Reward Value" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="flag-description">{{_("Description")}}</label>
                    <div class="controls">
                        <textarea rows="4" class="toolbar" id="flag-description" name="description" type="text" placeholder="{{_('Description')}}"></textarea>
                    </div>
                </div>
                <div id="casegroup" class="control-group">
                    <label class="control-label" for="case-sensitive">{{_("Case-Sensitive")}}</label>
                    <div class="controls">
                        <input id="flag-case-sensitive" name="case-sensitive" type="hidden" value=1 />
                        <div id="case-button" class="btn-group" data-toggle="buttons-radio"
                            rel="popover"
                            data-original-title="{{_('Case-Sensitive')}}"
                            data-content="{{_('Enabling this option will set the token to be case sensitive.  If this option is disabled, the answer token is case-insensitive.')}}">
                            <button id="case-enable" type="button" class="btn btn-success">
                                <i id="case-enable-icon" class="fa fa-fw fa-check-square-o"></i>
                                {{_("Enable")}}
                            </button>
                            <button id="case-disable" type="button" class="btn btn-danger">
                                <i id="case-disable-icon" class="fa fa-fw fa-square-o"></i>
                                {{_("Disable")}}
                            </button>
                        </div>
                    </div>
                </div>
                <div id="flagtokengroup" class="control-group">
                    <label class="control-label" for="flag-token">{{_("Token")}}</label>
                    <div class="controls">
                        <input id="flag-token" name="token" type="text" maxlength="256" placeholder="{{_('Token Value')}}" />
                    </div>
                </div>
                <div id="testflaggroup" class="control-group">
                    <label class="control-label" for="test_token">{{_("Test Flag")}}</label>
                    <div class="controls" style="position:relative;">
                        <span style="position: absolute; left: 230px; top: 3px; font-size: 175%;">
                            <i id="testtrue" class="fa fa-check" style="color: green; display: none;"></i>
                            <i id="testfalse" class="fa fa-times" style="color: red; display: none;"></i>
                        </span>
                            <input id="test-token" name="test_token" type="text" placeholder="{{_('Enter a Matching Flag')}}" autocomplete="off"
                                rel="popover"
                                data-original-title="{{_('Token')}}"
                                data-content="{{ _('This is a test flag/string the user could input for credit.')}}" />
                    </div>
                </div>
                <div id="choicegroup" class="control-group" style="margin-bottom: 10px;">
                    <label class="control-label" for="token" style="margin-left: -20px;">{{_("Multiple Choice") }}</label>
                    <div class="controls">
                        <div class="input-group control-group after-add-more" style="position: relative; margin-bottom: 10px;">
                            <input type="radio" name="multichoice" style="position: absolute; left: -22px; top: 4px;" required /><input type="text" name="choice" maxlength="256" class="form-control" placeholder="{{_('Enter Choice')}}">
                            <div class="input-group-btn" style="position: absolute; left: 228px; top: 0px;"> 
                                <button class="btn btn-success add-more" type="button"style="padding: 4px 10px 0px; vertical-align: middle;"><i class="fa fa-plus" style="font-size: 160%;"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
                 <!-- Copy Fields -->
                <div class="copy hide">
                    <div class="choice-control-group input-group" style="margin-bottom: 10px; position: relative;">
                        <input type="radio" name="multichoice" style="position: absolute; left: -22px; top: 4px;" /><input type="text" name="choice" maxlength="256" class="form-control" placeholder="{{_('Enter Choice')}}">
                        <div class="input-group-btn" style="position: absolute; left: 228px; top: 0px;"> 
                            <button class="btn btn-danger remove" type="button" style="padding: 3px 10px 1px; vertical-align: middle;"><i class="fa fa-times" style="font-size: 160%;"></i></button>
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="edit-flag-lock">{{_("Dependent Flag")}}</label>
                    <div class="controls">
                        <select id="edit-flag-lock" name="lock_uuid"></select>
                    </div>
                </div>
                {% if options.story_mode %}
                <div class="control-group">
                    <label class="control-label" for="flag-capture_message">{{_("Capture Message")}}</label>
                    <div class="controls">
                        <textarea rows="4" id="flag-capture_message" name="capture_message" placeholder="({{_('Optional')}}">
                        </textarea>
                    </div>
                </div>
                {% end %}
            </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="edit-flag-submit" type="button" class="btn btn-primary">
                <i class="fa fa-fw fa-save"></i>
                {{_("Save")}}
            </button>
        </div>
    </div>
    <div id="delete-flag-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-times-circle-o"></i> {{_("Delete Flag")}}</h3>
        </div>
        <div class="modal-body">
        <p>
            {{_("Are you sure you want to delete this flag?")}} <br />
        </p>
        <form id="delete-flag-form" method="post" action="/admin/delete/flag">
            {% raw xsrf_form_html() %}
            <input id="delete-flag-uuid" name="uuid" type="hidden" value="" />
        </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="delete-flag-submit" type="button" class="btn btn-danger">
                <i class="fa fa-fw fa-times-circle-o"></i>
                {{ _("Delete") }}
            </button>
        </div>
    </div>
    <!-- Edit Hint -->
    <div id="edit-hint-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-pencil"></i> {{_("Edit Hint")}}</h3>
        </div>
        <div class="modal-body">
            <form id="edit-hint-form" class="form-horizontal" method="post" action="/admin/edit/hint">
                {% raw xsrf_form_html() %}
                <input id="hint-uuid" name="uuid" value="" type="hidden" />
                <div class="control-group">
                    <label class="control-label" for="hint-price">{% if options.banking %}{{_("Price")}}{% else %}{{_("Cost")}}{% end %}</label>
                    <div class="controls">
                        <input id="hint-price" name="price" type="text" placeholder="{% if options.banking %}${% end %}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="hint-description">{{_("Description")}}</label>
                    <div class="controls">
                        <textarea rows="4" class="toolbar" id="hint-description" name="description" type="text" maxlength="1024" placeholder="{{_('Description')}}"></textarea>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="hint-flag_uuid">{{_("Flag")}}</label>
                    <div class="controls">
                        <select id="hint-flag_uuid" name="hint-flag_uuid"></select>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="edit-hint-submit" class="btn btn-primary" type="button">
                <i class="fa fa-fw fa-save"></i>
                {{_("Save")}}
            </button>
        </div>
    </div>
    <div id="delete-hint-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-times-circle-o"></i> {{_("Delete Hint")}}</h3>
        </div>
        <div class="modal-body">
        <p>
            {{_("Are you sure you want to delete this hint?")}} <br />
        </p>
        <form id="delete-hint-form" method="post" action="/admin/delete/hint">
            {% raw xsrf_form_html() %}
            <input id="delete-hint-uuid" name="uuid" type="hidden" value="" />
        </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="delete-hint-submit" type="button" class="btn btn-danger">
                <i class="fa fa-fw fa-times-circle-o"></i>
                {{_("Delete") }}
            </button>
        </div>
    </div>
    <!-- Add IP  -->
    <div id="add-ip-address-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3>
                <i class="fa fa-fw fa-plus"></i>
                {{_("Add IP address")}}
            </h3>
        </div>
        <div class="modal-body">
        <form id="add-ip-address-form" class="form-horizontal" method="post" action="/admin/edit/ip">
            {% raw xsrf_form_html() %}
            <input id="add-ip-address-uuid" name="box_uuid" type="hidden" />
            <div class="control-group">
                <label class="control-label" for="ip-address">{{_("New IP Address")}}</label>
                <div class="controls">
                    <input autofocus id="ip-address" name="ip_address" type="text" placeholder="192.168.1.1" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <label class="checkbox">
                        <input name="visible" value="true" type="checkbox" checked> {{_("Visible to Players")}}
                    </label>
                </div>
            </div>
        </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="add-ip-address-submit" type="button" class="btn btn-primary">
                <i class="fa fa-fw fa-plus"></i>
                {{_("Add")}}
            </button>
        </div>
    </div>
    <!-- Delete IP -->
    <div id="delete-ip-address-modal" class="modal hide fade" style="display: none; ">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3>
                <i class="fa fa-fw fa-times-circle-o"></i>
                {{_("Delete IP Address") }}
            </h3>
        </div>
        <div class="modal-body">
        <p>
            {{_("Are you sure you want to delete this IP address?")}} <br />
        </p>
        <form id="delete-ip-address-form" method="post" action="/admin/delete/ip">
            {% raw xsrf_form_html() %}
            <input id="delete-ip-address-uuid" name="ip_uuid" type="hidden" value="" />
        </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{ _("Close") }}</a>
            <button id="delete-ip-address-submit" type="button" class="btn btn-danger">
                <i class="fa fa-fw fa-times-circle-o"></i>
                {{_("Delete")}}
            </button>
        </div>
    </div>
    <!-- View Details -->
    <div id="details-flag-modal" class="modal hide fade" style="display: none; width:760px; margin-left:-380px;">
        <div class="modal-header" style="padding-bottom: 0; margin-bottom: 0;">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-flag"></i> {{ _("Flag Details") }}<span id="flag_value" style="float: right; font-size: 80%; padding-right: 50px; margin-top: 6px;"></span></h3>
            <h5>
                <table class="table">
                    <tbody id="details-flag">
                        <tr>
                            <td class="shortcolumn" style="padding-left: 30px;">
                                <br><strong>Name:&nbsp;&nbsp;</strong><span id="details_flag_name"></span>
                            </td>
                            <td class="descriptioncol" style="float: right; padding-right: 30px;">
                                <strong>Description:&nbsp;&nbsp;</strong><span id="details_flag_description"></span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="descriptioncol" style="padding-top: 0 !important; padding-left: 30px;">
                                <strong>Token:&nbsp;&nbsp;</strong><span id="details_flag_token"></span></span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table class="table" style="margin-left: -25px;">
                    <tr>
                        <td class='shortcolumn' style='width 50px; text-align: center;'>
                            <i class='fa fa-fw fa-times' style='color: rgb(200, 0, 0);'></i>
                            <strong>Attempts:&nbsp;&nbsp;</strong><span id="count_attempts"></span>
                        </td>
                        <td class='shortcolumn' style='width 50px; text-align: center;'>
                            <i class="fa fa-fw fa-check" style="color: green;"></i>
                            <strong>Captures:&nbsp;&nbsp;</strong><span id="count_captures"></span>
                        </td>
                        <td class='shortcolumn' style='width 50px; text-align: center;'>
                            <i class="fa fa-fw fa-medkit" style="color: rgb(200, 200, 0);"></i>
                            <strong>Hintes:&nbsp;&nbsp;</strong><span id="count_hints"></span>
                        </td>
                    </tr>
                </table>
            </h5>
        </div>
        <hr  style="border-top: 1px solid #333; margin-top: -5px; margin-bottom: 21px; margin-left: 15px; margin-right: 30px;"/>
        <div class="modal-body" style="padding-top: 0; margin-top: -20px;">
            <h4><i class="fa fa-fw fa-times" style="color: rgb(200, 0, 0);"></i> {{ _("Attempts") }}</h4>
            <div class="well" style="padding-bottom: 0px;">
                <table class="table table-striped">
                    <tbody id="details-attempts" style="width: 700px;"></tbody>
                </table>
            </div>
            <h4><i class="fa fa-fw fa-check" style="color: green;"></i> {{ _("Captures") }}</h4>
            <div class="well" style="padding-bottom: 0px;">
                <table class="table table-striped">
                    <tbody id="details-captures"></tbody>
                </table>
            </div>
            <h4>&nbsp;<i class="fa fa-fw fa-medkit" style="color: rgb(200, 200, 0);"></i> {{ _("Hints") }}</h4>
            <div class="well" style="padding-bottom: 0px;">
                <table class="table table-striped">
                    <tbody id="details-hints"></tbody>
                </table>
            </div>
        </div>
    </div>
    <!-- Accept Answer -->
    <div id="details-answer-modal" class="modal hide fade" style="display: none; width:560px; margin-left:-280px;">
        <div class="modal-header" style="padding-bottom: 0; margin-bottom: 0;">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h3><i class="fa fa-fw fa-flag"></i> {{ _("Accept Answer") }}</h3>
            <h5>
                <table class="table">
                    <tbody id="details-flag"></tbody>
                </table>
            </h5>
        </div>
        <div class="modal-body">
            <div style="margin: 10px 0 30px 25px; vertical-align: middle;">
                <h4>
                    <div id="answer-team" style="margin-left: 25px;"></div>
                </h4>
                <div class="descriptioncol" id="answer-flag" style="margin-left: 25px;text-align: center;"></div>
            </div>
            <div id="flagtypenote" style="display: none; text-align: center;">{{ _("Note: Can only update answers on static and regex flag types") }}.<br/><br/></div>
            <form id="stat-answer-form" method="post" action="/admin/view/game_objects">
            {% raw xsrf_form_html() %}
            <div style="margin-left: 50px; vertical-align: middle;">
                <input type="hidden" id="answer-flag-uuid" name="flag_uuid" value="" />
                <input type="hidden" id="answer-team-uuid" name="team_uuid" value="" />
                <input type="hidden" id="answer-token" name="answer_token" value="" />
                <p>
                    <input id="acceptanswer" name="accept_answer" type="checkbox" style="margin-top: -5px; margin-right: 5px;" checked> {{ _("Add the answer as an acceptable flag token") }}.
                </p>
                {% if options.penalize_flag_value %}
                <p id="pointrestore">
                    <input name="point_restore" type="checkbox" style="margin-top: -5px; margin-right: 5px;" checked> {{ _("Restore the penalty loss to the ") }}
                    {% if options.teams %}team{% else %}player{% end %} ({% if options.banking %}${% end %}<span id="answer-penalty"></span>{% if not options.banking %} points{% end %}).
                </p>
                {% end %}
            </div>
            </form>
        </div>
        <div class="modal-footer">
            <a href="#" class="btn" data-dismiss="modal">{{_("Close")}}</a>
            <button id="stat-answer-submit" class="btn btn-primary" type="button">
                <i class="fa fa-fw fa-save"></i>
                {{ _("Save") }}
            </button>
        </div>
    </div>
{% end %}

{% block content %}
    <!-- Start Visible -->
    <div class="row-fluid">
        <div class="span2">
            <ul id="navWrapper" class="nav nav-tabs nav-stacked affix well">
                {% if len(Corporation.all()) > 1 %}
                    <center>
                        <strong>
                            <i class="fa fa-building-o"></i>
                            {{_("Corporations")}}
                        </strong>
                    </center>
                    <br />
                    {% for corporation in Corporation.all() %}
                        <li>
                            <a href="#{{ corporation.uuid }}">
                                <i class="icon-chevron-right"></i>
                                &nbsp;&nbsp;{{ corporation.name }}
                            </a>
                        </li>
                    {% end %}
                <br/>
                {% end %}
                <center>
                    <strong>
                        <i class="fa fa-th"></i>
                        {{_("Boxes")}}
                    </strong>
                </center>
                <br />
                {% for box in Box.all() %}
                    <li>
                        <a href="#{{ box.uuid }}">
                            <i class="icon-chevron-right"></i>
                            &nbsp;&nbsp;{{ box.name }}
                        </a>
                    </li>
                {% end %}
            </ul>
        </div>
        <div class="span10">
            <h1>
                <i class="fa fa-bullseye"></i>
                {{_("Target Management")}}
            </h1>
            <br />
            {% if success is not None and len(success) != 0  %}
                {% for message in success %}
                    <div class="alert alert-success">
                        <a class="close" data-dismiss="alert" href="#">&times;</a>
                        <h4 class="alert-heading">{{ _("SUCCESS") }}</h4>
                        {{ message }}
                    </div>
                {% end %}
            {% end %}
            {% if errors != None and len(errors) != 0 %}
                {% for error in errors %}
                    <div class="alert alert-error">
                        <a class="close" data-dismiss="alert" href="#">&times;</a>
                        <h4 class="alert-heading">{{_("ERROR")}}</h4>
                        {{ error }}
                    </div>
                {% end %}
            {% end %}
            {% if len(Corporation.all()) > 0 %}
                {% for corp_index, corporation in enumerate(Corporation.all()) %}
                    <div id="{{ corporation.uuid }}" class="well">
                        <h2 style="display:inline;">
                            <i class="fa fa-fw fa-building-o"></i>
                            {{ corporation.name }}&nbsp;&nbsp;
                        </h2>
                        <a id="edit-corporation-button{{ corp_index }}" class="btn btn-small" data-toggle="modal" href="#edit-corporation-modal" data-uuid="{{ corporation.uuid }}">
                            <i class="fa fa-fw fa-pencil"></i>
                            {{_("Edit Corporation")}}
                        </a>
                        <a id="delete-corporation-button{{ corp_index }}" class="btn btn-small btn-danger" data-toggle="modal" href="#delete-corporation-modal" data-uuid="{{ corporation.uuid }}">
                            <i class="fa fa-fw fa-times-circle-o"></i>
                            {{_("Delete Corporation")}}
                        </a>
                        <br />{% if corporation.description %}<br>&nbsp;&nbsp;{{ corporation.description }}<br />{% end %}
                        <br />
                        {% if len(corporation.boxes) != 0 %}
                            {% for box in corporation.boxes %}
                                <div id="{{ box.uuid }}" class="well{% if box.locked %} locked{% end %}">
                                    <h3 style="display:inline;">
                                        {% if box.operating_system.lower() == 'windows' %}
                                            <i class="fa fa-windows"></i>
                                        {% elif box.operating_system.lower() == 'linux' %}
                                            <i class="fa fa-linux"></i>
                                        {% elif box.operating_system.lower() == 'apple' %}
                                            <i class="fa fa-apple"></i>
                                        {% elif box.operating_system.lower() == '?' %}
                                            <i class="fa fa-desktop"></i>
                                        {% else %}
                                            <i class="fa fa-th"></i>
                                        {% end %}
                                        {{ box.name }}&nbsp;&nbsp;
                                    </h3>
                                        {% if box.locked %}
                                            <a id="lock-box-button-{{ box.uuid }}" class="btn btn-small btn-success" data-uuid="{{ box.uuid }}">
                                                <i class="fa fa-fw fa-unlock"></i>
                                                {{_("Unlock")}}
                                            </a>
                                        {% else %}
                                            <a id="lock-box-button-{{ box.uuid }}" class="btn btn-small btn-warning" data-uuid="{{ box.uuid }}">
                                                <i class="fa fa-fw fa-lock"></i>
                                                {{_("Lock")}}
                                            </a>
                                        {% end %}
                                        <a id="edit-box-button-{{ box.uuid }}" class="btn btn-small" data-toggle="modal" href="#edit-box-modal" data-uuid="{{ box.uuid }}" data-corporation-uuid="{{ box.corporation.uuid }}">
                                            <i class="fa fa-pencil"></i>
                                            {{_("Edit Box")}}
                                        </a>
                                        <a class="btn btn-small"  data-toggle="modal" href="/user/missions/boxes?uuid={{ box.uuid }}">
                                            <i class="fa fa-fw fa-eye"></i>
                                            {{_("View Box")}}
                                        </a>
                                        <a id="delete-box-button-{{ box.uuid }}" class="btn btn-small btn-danger" data-toggle="modal" href="#delete-box-modal" data-uuid="{{ box.uuid }}">
                                            <i class="fa fa-times-circle-o"></i>
                                            {{_("Delete Box")}}
                                        </a>
                                        {% if options.use_bots %}
                                        <a style="float:right;" class="btn" data-toggle="modal" href="/admin/garbage?uuid={{ box.uuid }}" target="_blank">
                                            <i class="fa fa-fw fa-trash-o"></i>
                                            {{ box.name }} Bot {{_("Garbage File") }}
                                        </a>
                                        {% end %}
                                    <br />{% if box.category %}{{ box.category }}<br />{% end %}
                                    <br />
                                    <div>                   
                                        {% if box.avatar != "none" %}
                                        <div class="span4" style="margin: 0 30px 5px 5px;">
                                            <img src="/avatars/{{ box.avatar }}" class="img-polaroid" />
                                            <br /><br />
                                        </div>
                                        {% end %}
                                        <div class="preformatted" style="overflow: hidden; white-space: nowrap; text-align: center; margin-top: 5px;">***** {% if options.story_mode %}{{_("BEGIN SECURE COMMUNIQUE")}}{% else %}{{_("DESCRIPTION")}}{% end %} *****************************************************************************************************************************************</div>
                                        <div class="preformatted markdown" style="text-align: justify; padding: 0 20px; margin-left: 10px;">{{ box._description }}</div>
                                        <div class="preformatted" style="overflow: hidden; white-space: nowrap; text-align: center; margin: 0;">*****{% if options.story_mode %} {{_("END SECURE COMMUNIQUE")}} {% end %}**********************************************************************************************************************************************************************</div>
                                    </div>
                                    <br clear="all" />
                                    <!-- Start Flags -->
                                    <div class="startflags">
                                        <h4 style="display:inline;">
                                            <i class="fa fa-flag-o"></i>
                                            {{_("Flags on") }} {{ box.name }}&nbsp;&nbsp;&nbsp;
                                        </h4>
                                        <a class="btn btn-primary btn-mini" data-toggle="modal" href="/admin/create/flag?box={{box.uuid}}">
                                            <i class="fa fa-plus"></i>
                                            {{_("Add Flags") }}
                                        </a>
                                        <hr>
                                        {% if len(box.flags_all) != 0 %}
                                            <table class="table table-striped sort grid">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th><!-- Flag Lock --></th>
                                                        <th>{{_("Name")}}</th>
                                                        <th>{{_("Description")}}</th>
                                                        <th>{{_("Token")}}</th>
                                                        <th>{{_("Value")}}</th>
                                                        <th>{{_("Type")}}</th>
                                                        <th style="text-align: center;"><i class="fa fa-paperclip" title="Attachments"></i></th>
                                                        <th>&nbsp;<i class="fa fa-lock" title="Lock"></i></th>
                                                        <th>{{_("Statistics")}}</th>
                                                        <th><!-- Edit Button --></th>
                                                        <th><!-- Delete Button --></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    {% for index, flag in enumerate(box.flags_all) %}
                                                        <tr id="{{ flag.uuid }}" class="{% if flag.locked %} locked{% end %}">
                                                            <td class="index shortcolumn" data-uuid="{{ flag.uuid }}">{{ index + 1 }}</td>
                                                            <td class="shortcolumn" style="padding-right: 0px;">{% if flag.lock_id %}<i class="fa fa-lock" title="Locked by {{ Flag.by_id(flag.lock_id).name }}"></i>{% end %}</td>
                                                            <td class="shortcolumn" style="padding-right: 25px;">{{ flag.name }}</td>
                                                            <td class="descriptioncol markdown">{{ flag.description }}{% if flag.type == FLAG_CHOICE %}
                                                                {% set choices = FlagChoice.by_flag_id(flag.id) %}
                                                                {% if choices and len(choices) > 0 %}{% for item in choices %}- {{item.choice}}
                                                                {% end %}{% end %}{% end %}</td>
                                                            <td><div class="wordbreak">{{ flag.token }}</div></td>
                                                            <td class="shortcolumn" style="text-align: center;">{% if options.banking %}${% end %}{{ flag.value }}</td>
                                                            <td class="shortcolumn">{{ str(flag.type) }}</td>
                                                            <td class="shortcolumn" style="text-align: center;">
                                                                <a id="flag-attachment-button-{{ flag.uuid }}" class="btn btn-mini" data-toggle="modal" href="#flag-attachment-button" data-uuid="{{ flag.uuid }}">
                                                                    {{ len(flag.flag_attachments) }}
                                                                </a>
                                                            </td>
                                                            <td class="shortcolumn">
                                                                {% if flag.locked %}
                                                                <a id="lock-flag-button-{{ flag.uuid }}" class="btn btn-mini btn-success" data-uuid="{{ flag.uuid }}">
                                                                    <i class="fa fa-unlock" title="Lock Flag"></i>
                                                                </a>
                                                                {% else %}
                                                                <a id="lock-flag-button-{{ flag.uuid }}" class="btn btn-mini btn-warning" data-uuid="{{ flag.uuid }}">
                                                                    <i class="fa fa-lock" title="Unlock Flag"></i>
                                                                </a>
                                                                {% end %}
                                                            </td>
                                                            <td class="shortcolumn">
                                                                <a id="details-flag-button-{{ flag.uuid }}" class="btn btn-mini" data-toggle="modal" href="#details-flag-modal" data-uuid="{{ flag.uuid }}" data-box-uuid="{{ flag.box.uuid }}" title="{{flag.token}}">
                                                                    <i class="fa fa-fw fa-eye"></i>
                                                                    {{ _("Details") }}
                                                                </a>
                                                            </td>
                                                            <td class="shortcolumn">
                                                                <a id="edit-flag-button-{{ flag.uuid }}" class="btn btn-mini" data-toggle="modal" href="#edit-flag-modal" data-flagtype="{{ str(flag._type) }}" data-uuid="{{ flag.uuid }}" data-box-uuid="{{ flag.box.uuid }}">
                                                                    <i class="fa fa-fw fa-pencil"></i>
                                                                    {{_("Edit Flag") }}
                                                                </a>
                                                            </td>
                                                            <td class="shortcolumn">
                                                                <a id="delete-flag-button-{{ flag.uuid }}" class="btn btn-danger btn-mini" data-toggle="modal" href="#delete-flag-modal" data-uuid="{{ flag.uuid }}">
                                                                    <i class="fa fa-fw fa-times-circle-o"></i>
                                                                    {{_("Delete")}}
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    {% end %}
                                                </tbody>
                                            </table>
                                        {% end %}
                                    </div>
                                    <!-- End Flags -->
                                    <br />
                                    <!-- Start Hints -->
                                    <div class="starthints">
                                        <h4 style="display:inline;">
                                            <i class="fa fa-medkit"></i>
                                            {{_("Hints on")}} {{ box.name }}&nbsp;&nbsp;&nbsp;
                                        </h4>
                                        <a class="btn btn-primary btn-mini" data-toggle="modal" href="/admin/create/hint?box={{box.uuid}}">
                                            <i class="fa fa-plus"></i>
                                            {{_("Add Hint")}}
                                        </a>
                                        <hr>
                                        {% if len(box.hints) != 0 %}
                                            {% set boxhints = [] %}
                                            {% set flaghints = [] %}
                                            {% for index, hint in enumerate(box.hints) %}
                                                {% if hint.flag_id %}
                                                    {% set flaghints.append(hint) %}
                                                {% else %}
                                                    {% set boxhints.append(hint) %}
                                                {% end %}
                                            {% end %}
                                        
                                            {% if len(flaghints) > 0 %}
                                            <h5>{{_("Flag Hints")}}</h5>
                                            <table class="table table-striped">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th>{% if options.banking %}{{_("Price")}}{% else %}{{_("Cost")}}{% end %}</th>
                                                        <th>{{_("Flag")}}</th>
                                                        <th>{{_("Description")}}</th>
                                                        <th><!-- Edit Button --></th>
                                                        <th><!-- Delete Button --></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    {% for index, hint in enumerate(flaghints) %}
                                                        <tr>
                                                            <td class="shortcolumn">{{ index + 1 }}</td>
                                                            <td class="shortcolumn" style="text-align: center;">{% if options.banking %}{{_("$")}}{% end %}{{ hint.price }}</td>
                                                            <td class="shortcolumn flagname" style="padding-right: 25px;">{{ Flag.by_id(hint.flag_id).name }}</td>
                                                            <td class="descriptioncol markdown">{{ hint.description }}</td>
                                                            <td class="shortcolumn">
                                                                <a id="edit-hint-button-{{ hint.uuid }}" class="btn btn-mini" data-toggle="modal" href="#edit-hint-modal" data-uuid="{{ hint.uuid }}" data-box-uuid="{{ hint.box.uuid }}">
                                                                    <i class="fa fa-fw fa-pencil"></i>
                                                                    {{_("Edit Hint")}}
                                                                </a>
                                                            </td>
                                                            <td class="shortcolumn">
                                                                <a id="delete-hint-button-{{ hint.uuid }}" class="btn btn-danger btn-mini" data-toggle="modal" href="#delete-hint-modal" data-uuid="{{ hint.uuid }}">
                                                                    <i class="fa fa-fw fa-times-circle-o"></i>
                                                                    {{_("Delete")}}
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    {% end %}
                                                </tbody>
                                            </table>
                                            {% end %}
                                            {% if len(boxhints) > 0 %}
                                            <h5>{{_("Box Hints")}}</h5>
                                            <table class="table table-striped">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th>{% if options.banking %}{{_("Price")}}{% else %}{{_("Cost")}}{% end %}</th>
                                                        <th>{{_("Description")}}</th>
                                                        <th><!-- Edit Button --></th>
                                                        <th><!-- Delete Button --></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    {% for index, hint in enumerate(boxhints) %}
                                                        <tr>
                                                            <td class="shortcolumn">{{ index + 1 }}</td>
                                                            <td class="shortcolumn" style="text-align: center;">{% if options.banking %}{{_("$")}}{% end %}{{ hint.price }}</td>
                                                            <td class="descriptioncol markdown">{{ hint.description }}</td>
                                                            <td class="shortcolumn">
                                                                <a id="edit-hint-button-{{ hint.uuid }}" class="btn btn-mini" data-toggle="modal" href="#edit-hint-modal" data-uuid="{{ hint.uuid }}" data-box-uuid="{{ hint.box.uuid }}">
                                                                    <i class="fa fa-fw fa-pencil"></i>
                                                                    {{_("Edit Hint")}}
                                                                </a>
                                                            </td>
                                                            <td class="shortcolumn">
                                                                <a id="delete-hint-button-{{ hint.uuid }}" class="btn btn-danger btn-mini" data-toggle="modal" href="#delete-hint-modal" data-uuid="{{ hint.uuid }}">
                                                                    <i class="fa fa-fw fa-times-circle-o"></i>
                                                                    {{_("Delete")}}
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    {% end %}
                                                </tbody>
                                            </table>
                                            {% end %}
                                        {% end %}
                                    </div>
                                    <!-- End Hints -->
                                    <br/>
                                    <!-- Start IPs -->
                                    <div class="startips">
                                        <h4 style="display:inline;">
                                            <i class="fa fa-fw fa-globe"></i>
                                            {{_("IP Address")}}&nbsp;&nbsp;
                                        </h4>
                                        <a id="add-ip-address-button-{{ box.uuid }}" class="btn btn-primary btn-mini" data-toggle="modal" href="#add-ip-address-modal" data-uuid="{{ box.uuid }}">
                                            <i class="fa fa-fw fa-plus"></i>
                                            {{_("Add IP Address")}}
                                        </a>
                                        <br />
                                        <hr>
                                        {% if len(box.ip_addresses) != 0 %}
                                            <table class="table table-striped">
                                                <thead>
                                                    <tr>
                                                        <th>#</th>
                                                        <th>{{_("Address")}}</th>
                                                        <th>{{_("IP Version")}}</th>
                                                        <th>{{_("Visible")}}</th>
                                                        <th><!-- Delete --></th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    {% for index, ip in enumerate(box.ip_addresses) %}
                                                        <tr>
                                                            <td>{{ index + 1 }}</td>
                                                            <td>{{ ip.address }}</td>
                                                            <td>{{ ip.version }}</td>
                                                            <td>{% if ip.visible %} {{_("Yes")}} {% else %} {{_("No")}} {% end %}</td>
                                                            <td class="shortcolumn">
                                                                <a id="delete-ip-address-button-{{ ip.uuid }}" class="btn btn-danger btn-mini" data-toggle="modal" href="#delete-ip-address-modal" data-uuid="{{ ip.uuid }}">
                                                                    <i class="fa fa-fw fa-times-circle-o"></i>
                                                                    {{_("Delete")}}
                                                                </a>
                                                            </td>
                                                        </tr>
                                                    {% end %}
                                                </tbody>
                                            </table>
                                        {% end %}
                                    </div>
                                    <!-- End IPs -->
                                </div>
                                <br />
                            {% end %}
                        {% else %}
                            <strong>{{_("No boxes in this corporation yet")}}, <a href="/admin/create/box">{{_("add some")}}</a></strong>
                        {% end %}
                    </div>
                {% end %}
            {% else %}
                <strong>{{_("No boxes in this corporation yet")}}, <a href="/admin/create/box">{{_("add some")}}</a></strong>
            {% end %}
        </div>
    </div>
{% end %}